#include <assert.h>
#include <dlfcn.h>
#include <stdio.h>

void mainX(int argc, const char** argv, const char **envp) {
    const char *filename = NULL;

    int flag = RTLD_NOW|RTLD_GLOBAL;
    
    void *handle = dlopen(filename, flag);

    const char *symbol = "mainX";

    assert(dlerror() == NULL);

    void * function = dlsym(handle, symbol);

    assert(function != 0);

    if (filename != NULL) {
        assert(dlclose(handle) == 0); 
    }
}

